set visible of cd field "script" to not visible of cd field "script"
if visible of cd field "script" is true then
set name of cd button id 8 to "Hide script"
else
set name of cd button id 8 to "Show script"
end if
end mouseUp
-- part 9 (field)
-- low flags: 81
-- high flags: 0004
-- rect: left=9 top=66 right=278 bottom=506
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 0
-- font id: 3
-- text size: 9
-- style flags: 0
-- line height: 12
-- part name: script
-- part 11 (button)
-- low flags: 00
-- high flags: A003
-- rect: left=90 top=284 right=306 bottom=190
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Copy to stack
----- HyperTalk script -----
on mouseUp
answer "Select a stack to copy this function to."
put FileName("STAK") into theStack
if it is empty then exit mouseUp
set lockscreen to true
push this card
put cd field "script" into theScript
put script of stack theStack into temp
put return & return & theScript after temp
set script of stack theStack to temp
end mouseUp
-- part contents for card part 5
----- text -----
FirstPathComponent extracts the first component of a file's full pathName and places it into a holder. For instance, if you're using a hard disk, the full path might be:
"Hard Disk:Stackware:MyStack"
FirstPathComponent will put the first component "Hard Disk" into the holder "results".
NOTE: This function makes necessary use of the FileName XFCN, which was written by Steve Maller and which is available on most bulletin boards. You can copy if from this stack if you want.
written by Bob Patin
This stack is FREEWARE from:
Missing Byte Software
112 Hickory Park Lane
Antioch, TN 37013
615/331-6925
-- part contents for card part 9
----- text -----
on firstPathComponent
global results
set lockscreen to true
put FileName() into longName
put the length of longName into theLength
put "" into shortname
put 1 into i
repeat until i > theLength
if character i of longName is ":" then exit repeat